package com.neusoft.yiyang.care.service.impl;

import com.neusoft.yiyang.common.entity.care.CareLevel;
import com.neusoft.yiyang.care.mapper.CareLevelMapper;
import com.neusoft.yiyang.care.service.CareLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CareLevelServiceImpl implements CareLevelService {

    @Autowired
    private CareLevelMapper careLevelMapper;

    @Override
    public List<CareLevel> getAllCareLevels() {
        return careLevelMapper.selectList(null);
    }

    @Override
    public CareLevel getCareLevelById(Integer careLevelId) {
        return careLevelMapper.selectById(careLevelId);
    }

    @Override
    public void addCareLevel(CareLevel careLevel) {
        careLevelMapper.insert(careLevel);
    }

    @Override
    public void updateCareLevel(CareLevel careLevel) {
        careLevelMapper.updateById(careLevel);
    }

    @Override
    public void deleteCareLevel(Integer careLevelId) {
        careLevelMapper.deleteById(careLevelId);
    }
}
